<!-- 头部组件 -->
<template>
    <div id="nav">
        <div class="head">
            <div class="l-btn" onclick="window.history.back()"></div>
            <div class="header clear">新闻资讯</div>
            <div class="zero"></div>
        </div>
        <div class="nav">
            <ul class="clear">
                <router-link tag="li" to="/nav" active-class="active">
                    <a href="javascript:;">最新最热</a>
                </router-link>
                <router-link tag="li" to="/follow" active-class="active">
                    <a href="javascript:;">市政要闻</a>
                </router-link>
                <router-link tag="li" to="/column" active-class="active">
                    <a href="javascript:;">二院动态</a>
                </router-link>
                <router-link tag="li" to="/columnTwo" active-class="active">
                    <a href="javascript:;">三院动态</a>
                </router-link>
                <router-link tag="li" to="/onlyOne" active-class="active">
                    <a href="javascript:;">抗疫专栏</a>
                </router-link>
            </ul>
        </div>
    </div>
</template>
<script>
export default {
  data() {
    return {
      arrList: []
    };
  },
  mounted() {
    // 获取数据
    this.fetchData();
  },
  methods: {
    fetchData() {
      var _this = this;
      this.$http
        .get("src/data/index.data")
        .then(function(res) {
          _this.arrList = res.data;
        })
        .catch(function(err) {
          console.log(err);
        });
    }
  }
};
</script>
<style scoped>
.head {
  width: 100%;
  height: 0.7rem;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgb(59, 62, 223);
  border-bottom: 1px solid #e8eaec;
  z-index: 99;
}
.l-btn {
  width: 30%;
  height: 1rem;
  background: url(../../assets/images/history.png) no-repeat 0 0;
  margin-top: 0.5rem;
  background-size: 0.6rem;
}
.header {
  width: 30%;
  font-size: 0.4rem;
  color: #f2f4f5;
}
.zero {
  width: 30%;
}
.nav {
  width: 100%;
  z-index: 2;
  background: #fff;
  margin-top: 0.7rem;
}
.nav ul {
  width: 100%;
  height: 0.8rem;
  display: flex;
}
.nav ul li {
  width: 20%;
}
.nav ul li a {
  display: block;
  line-height: 0.8rem;
  text-align: center;
}
.nav ul li.active a {
  height: 0.7rem;
  border-bottom: 0.05rem solid #5477b2;
  color: #5477b2;
}
.banner {
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.banner ul li {
  width: 6.4rem;
  height: 3rem;
  float: left;
  position: relative;
}
.banner ul li img {
  width: 100%;
  display: block;
}
.banner ul li .text-box {
  width: 100%;
  padding: 0 0.3rem;
  height: 0.6rem;
  position: absolute;
  left: 0;
  bottom: .25rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
}
.text-box h2 {
  font-size: 0.26rem;
  font-weight: normal;
  margin-top: 0.22rem;
  line-height: 100%;
  margin-bottom: 0.22rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.text-box p {
  /* line-height:100%; */
  font-size: 0.3rem;
}
.newsList ul li {
    padding: 0.1rem;
  display: flex;
}
.left {
  width: 70%;
}
.right {
  width: 30%;
  height: 60%;
}
.right img {
  width: 100%;
  height: 100%;
}
</style>